<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.pojo.job" %>
<%@ page import="com.dao.*" %>
<!DOCTYPE html>
<%
  jobDb jd = new jobDb();
  HashMap<String, job> jobs = jd.selectJob();
  jd.close();
  session.setAttribute("jobs",jobs);
%>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="./layui/css/layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<%
  job job;

%>
<!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">-->
<!--  <legend>水平导航菜单</legend>-->
<!--</fieldset>-->

<ul class="layui-nav" >
  <li class="layui-nav-item layui-this"><a href="test.jsp">主页</a></li>
  <li class="layui-nav-item">
    <a href="javascript:;">职位</a>
  </li>
  <li class="layui-nav-item"><a href="./jpg/c语言学历要求.png">导航</a></li>
  <li class="layui-nav-item">
    <a href="javascript:;">职位搜索</a>
    <dl class="layui-nav-child">
      <dd><a href="searchJob.jsp">职位名搜索</a></dd>
      <dd><a href="">地点搜索</a></dd>
    </dl>
  </li>
  <li class="layui-nav-item">
    <a href="javascript:;">选项</a>
    <dl class="layui-nav-child">
      <dd><a href="">选项1</a></dd>
      <dd class="layui-this"><a href="">选项2</a></dd>
      <dd><a href="">选项3</a></dd>
    </dl>
  </li>
  <li class="layui-nav-item"><a href="">演示</a></li>
</ul>

<!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">-->
<!--  <legend>显示完整功能</legend>-->
<!--</fieldset>-->
<table lay-filter="demo">
  <thead>
  <tr>
    <th lay-data="{field:'job_name', width:235}">职位</th>
    <th lay-data="{field:'job_company', width:375}">公司名</th>
    <th lay-data="{field:'wage', width:152}">薪资</th>
    <th lay-data="{field:'position', width:171}">地点</th>
    <th lay-data="{field:'job_info', width:330}">条件</th>
    <th lay-data="{field:'job_desc', width:400}">岗位描述</th>
<%
  for(HashMap.Entry<String,job>entry:jobs.entrySet()){
    job=(job)entry.getValue();%>
<!--    <th lay-data="{field:'sign'}">职责描述</th>-->
  </tr>
  </thead>
  <tbody>
  <tr>
    <td><%=job.getJob_name() %></td>
    <td><%=job.getJob_company() %></td>
    <td><%=job.getWage() %></td>
    <td><%=job.getPosition()%></td>
    <td><%=job.getJob_info() %></td>
    <td><%=job.getJob_desc()%></td>
  </tr>

  </tbody>
  <%}%>
</table>


<script src="./layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->
<script>
  layui.use('element', function(){
    var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

    //监听导航点击
    element.on('nav(demo)', function(elem){
      //console.log(elem)
      layer.msg(elem.text());
    });
  });
  layui.use(['laypage', 'layer'], function(){
    var laypage = layui.laypage
            ,layer = layui.layer;

    //完整功能
    laypage.render({
      elem: 'demo7'
      ,count: 100
      ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
      ,jump: function(obj){
        console.log(obj)
      }
    });

  });
  layui.use('table', function(){
    var table = layui.table;

//转换静态表格
    table.init('demo', {
      height: 750 //设置高度
      ,limit: 20 //注意：请务必确保 limit 参数（默认：10）是与你服务端限定的数据条数一致
      //支持所有基础参数
      ,page:true
    });
  });
</script>

</body>
</html>